﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CommentList.aspx.cs" Inherits="ZLCMS.Web.Wap.Shop.CommentList"
    MasterPageFile="~/Wap/Shop/ShopSite.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%@ register src="Footer.ascx" tagname="Footer" tagprefix="uc1" %>
    <title>评价中心</title>

    <style type="text/css">
	#nav li{ border-left:1px solid #ddd;box-sizing: border-box;  -webkit-box-sizing: border-box; -moz-box-sizing: border-box; border-bottom:1px solid #ddd;}
	#nav li:nth-child(1){ border-left:none;}
	#navFixed .ui-navbar ul li a.ui-btn-active{ color:#f9384d; border-bottom-color:#f9384d;}	
	#navFixed .ui-navbar ul li a{border-bottom-color:#fff;}	
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server">
    <div data-role="page" id="mypage">
        <!--S header -->
        <div data-role="header">
        </div>

        <!-- /navbar -->
        <div role="main" class="ui-content">
                <input type="hidden" id="Status" value="<%=Request["cs"] %>" />
                <input type="hidden" id="MemberAccount" value='<%=CurrentMemberAccount %>' />

<% if (string.IsNullOrEmpty(Request["ono"]))
   { %>
<%--无指定订单号，则为查所有评论 --%>
    	<!--s nav-->
        <div id="navFixed" >
        <div id="nav">
        	<div data-role="navbar" nav="navFixed">
              <ul>
                <li><a href="#" data-theme="f" class='ui-btn-active'>待评价</a></li>
                <li><a href="/Wap/Shop/CommentHistory.aspx" data-theme="f" data-ajax="false">已评价</a></li>
              </ul>
            </div>
        </div>
        </div>
        <!--e nav-->
<%}
   else
   { %>
            <div class="refundTop">
                <a href="javascript:void(0)" onclick="history.back()" data-ajax="false"><img src="images/arrowLeftCom.png" /></a>
                评价中心
            </div>    
  <%} %>
            <div class='commentProductList'>
            </div>

       <div style="display:none">
        <button id="btnMore" data-icon="refresh" style="width: 95%; margin-left: auto; margin-right: auto;">显示更多</button>
       </div>

        </div>
        <!--S footer -->
        <div data-role="footer" data-position="fixed" data-tap-toggle="false">
            <uc1:Footer ID="Footer1" runat="server" MenuId="M" />
        </div>
        <!--E footer -->
    </div>
    <script src="/wap/lib/common/listviewHandler.js" type="text/javascript"></script>
    <script type="text/javascript">
        function queryData(data) 
        {
            $('#commentProductList').empty();
            $('#Status').val(data);
            LoadCommentList();
        };

        function LoadCommentList() {
            var handler = $('.commentProductList').listviewHandler();
            handler.initialize({
                loaderBtn: $('#btnMore'), //加载数据按钮（点击加载下一页）
                emptyHtml: '<div style="text-align: center; font-size: 12px; color:#666; margin-top:2em">-- 暂无记录 --</div>', //无记录时显示此html
                itemTemplate: ' <div class="all_comment">'
                              + '<a href="{GotoUrl}" data-ajax="false">'
                              + ' <div class="bottom">'
                              + '<div class="left"><img src="{ThumbnailImg}"></div>'
                              + '  <div class="right">'
                              + ' 	<h2>{ProductName}</h2>'
                              + '<p>单价：<span>￥{SalePrice}</span></p>'
                              + ' </div>'
                              + ' <div class="clear"></div>'
                              + ' </div></a>'
        	                  + '<div class="foot">'
                              + '<div class="right">{ActionHtml}</div>'
                              + ' <div class="clear"></div>'
                              + ' </div>'
                              + ' </div>', //项模板
                pageIndex: 1, //页码（从1起算）
                pageSize: 20, //页大小
                totalCount: 999, //总记录数
                itemHandler: function (data, itemTemplate, container) {//数据各项处理
                    if (data.CommentStatus == "0") {
                        data.GotoUrl = 'javascript:void(0)';
                        //data.CommentStatus = '<font color="red">[未评论]</font>';
                        data.ActionHtml = '<a href="/wap/shop/CommentDetail.aspx?ono={OrderNo}&no={ProductNo}" class="btn" data-ajax="false" >马上评价</a>'
                                          .format({ ProductNo: data.ProductNo, OrderNo: data.OrderNo });
                    } else {
                        data.GotoUrl = 'javascript:void(0)';
                        //data.CommentStatus = '<font color="grey">[已评论]</font>';
                        data.ActionHtml = '<a href="/Wap/Shop/CommentHistory.aspx?ono={OrderNo}&no={ProductNo}" class="btn" data-ajax="false" >查看评价</a>'
                                            .format({ ProductNo: data.ProductNo, OrderNo: data.OrderNo });
                    }

                    data.ThumbnailImg = firstFilePath(data.ThumbnailImg);

                    return itemTemplate.format(data);
                },
                command: 'Member.LoadCommentabeProducts',
                parameter: { MemberAccount: $("#MemberAccount").val(), OrderNo: '<%=Request["ono"] %>', CommentStatus: $('#Status').val() }
            });
            handler.nextPage();
        }
        $(function () {
            LoadCommentList();
        })
    </script>
</asp:Content>
